n=1; while :; do
        msga="/tmp/msg.a.$n"
        msgb="/tmp/msg.b.$n"
        out="/tmp/out.$n"
        head -c $n </dev/urandom >$msga
        ./tp1-encode <$msga >$out
        ./tp1-decode <$out >$msgb
        if diff $msga $msgb; then :; else
                echo ERROR: ver $msga, $msgb, $out.
                break;
        fi
        echo Ok: $n;
        rm -f "$msga" "$msgb" "$out"
        n=`expr $n + 1`;
done

